import { createRouter, createWebHistory } from "vue-router";
import Index from "@/views/index.vue"


export default createRouter({
  history: createWebHistory("/"),
  routes: [
    {
      path: "/",
      redirect: "/index",
    },
    {
      path: "/index",
      name: "Index",
      component: Index,
    },
    {
      path: "/admin",
      name: "Admin",
      component: ()=>import('@/views/login_register.vue'),
      children:[
        {
          path: "login",
          name: "Login",
          component: ()=>import('@/components/login_register/login.vue'),
        },
        {
          path: "register",
          name: "Register",
          component: ()=>import('@/components/login_register/register.vue'),
        }
      ]
    },
    {
      path: "/cropping",
      name: "Cropping",
      component: ()=>import('@/components/cropping/index.vue'),
    },
    {
      path: "/lookOver",
      name: "LookOver",
      component: ()=>import('@/components/look_over/index.vue'),
    },
    {
      path:'/:catchAll(.*)',
      name:'NotFound',
      component: ()=>import('@/components/not_found/index.vue')
    }
  ]
});
